diff --git a/lib/matplotlib/_constrained_layout.py b/lib/matplotlib/_constrained_layout.py
index 457e0fbf29..7d866cd554 100644
--- a/lib/matplotlib/_constrained_layout.py
+++ b/lib/matplotlib/_constrained_layout.py
@@ -210,12 +210,18 @@ def make_layoutgrids_gs(layoutgrids, gs):
                 name='top',
                 nrows=1, ncols=1,
                 parent_pos=(subplot_spec.rowspan, subplot_spec.colspan))
+        # Convert rowspan and colspan to arrays of indices for broadcasting
+        row_indices = np.arange(subplot_spec.rowspan.start, subplot_spec.rowspan.stop)
+        col_indices = np.arange(subplot_spec.colspan.start, subplot_spec.colspan.stop)
+        # Ensure parent_pos is a tuple of arrays that can be broadcast together
+        parent_pos = (row_indices, col_indices)
         layoutgrids[gs] = mlayoutgrid.LayoutGrid(
                 parent=layoutgrids[f'{gs}top'],
                 name='gridspec',
                 nrows=gs._nrows, ncols=gs._ncols,
                 width_ratios=gs.get_width_ratios(),
-                height_ratios=gs.get_height_ratios())
+                height_ratios=gs.get_height_ratios(),
+                parent_pos=parent_pos)
     return layoutgrids
 
 
